<script language='javascript' type='text/javascript' src="<?=base_url('products')?>scripts/products.js"></script>
<?php echo form_open($this->products_list_model->url_prefix); ?>
<?if($msg){?><center><div class="messageBox"><?=$msg?></div></center><?}?>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="text">
  <tr align="center" id="listTableHeader"> 
	<td width="30"><a href="javascript:products.sortColumn(<?=$start?>, 'id', '{language}')"{sort_id}>#</a></td>
    <td width="15"><input type="checkbox" onclick="common.mark_all_rows('uid[]', this.checked)" /></td>
	<td width="250">Nhóm SP</td>
    <td width="150"><a href="javascript:products.sortColumn(<?=$start?>, 'name', '{language}')"{sort_title}>Tên hàng</a></td>
	<td width="100"><a href="javascript:products.sortColumn(<?=$start?>, 'date', '{language}')"{sort_date}>Ngày cập nhật</a></td>
    <td  width="200">Đặc tính sản phẩm</td>
	<td width="150">Hình ảnh</td>
	<td width="60">Trạng thái</td>
	<td width="60">Mới</td>
	<td width="60">SP Hot</td>
    <td width="60">Xử lý</td>
  </tr>
<?$i=1;foreach($items as $item){?>
  <tr class="row<?=($i==1)?'1':'2'?>">
	<td><?=$item->{PRODUCTS_PRODUCT_ID}?></td>
    <td><input type="checkbox" name="uid[]" value="<?=$item->{PRODUCTS_PRODUCT_ID}?>" /></td>
	<td align="left" style="font-weight:bold"><?=h($item->product_cate_name)?> >> <?=h($item->goup_name)?></td>
	<td align="left" style="font-weight:bold"><?=h($item->{PRODUCTS_NAME})?></td>
    <td><?=mysql_to_shortdate($item->{PRODUCTS_UPDATE_DATE})?></td>
    <td align="left"><?=($item->{PRODUCTS_PROPERTIES})?></td>
	<td align="center"><img src="<?=h($item->image_path)?>" width="100px" /></td>
	<td width="30" align="center"><a href="#" onclick="common.switch_status('<?= site_url('admin_ajax/products.products_process.change_status/' . $item->{PRODUCTS_PRODUCT_ID})?>', 'activediv_<?=$item->{PRODUCTS_PRODUCT_ID}?>');"><div id = "activediv_<?=$item->{PRODUCTS_PRODUCT_ID}?>" class="<?=$item->{PRODUCTS_STATUS} == 1 ? 'active_icon' : 'inactive_icon'?>"></div></a></td>
	<td width="30" align="center"><a href="#" onclick="common.switch_status('<?= site_url('admin_ajax/products.products_process.change_newest/' . $item->{PRODUCTS_PRODUCT_ID})?>', 'newdiv_<?=$item->{PRODUCTS_PRODUCT_ID}?>');"><div id = "newdiv_<?=$item->{PRODUCTS_PRODUCT_ID}?>" class="<?=$item->{PRODUCTS_NEWEST} == 1 ? 'active_icon' : 'inactive_icon'?>"></div></a></td>
	<td width="30" align="center"><a href="#" onclick="common.switch_status('<?= site_url('admin_ajax/products.products_process.change_best/' . $item->{PRODUCTS_PRODUCT_ID})?>', 'bestdiv_<?=$item->{PRODUCTS_PRODUCT_ID}?>');"><div id = "bestdiv_<?=$item->{PRODUCTS_PRODUCT_ID}?>" class="<?=$item->{PRODUCTS_BEST_SELL} == 1 ? 'active_icon' : 'inactive_icon'?>"></div></a></td>
    <td>
        <a href="<?=site_url($this->products_list_model->url_prefix2.'/'.$group.'/'.$start.'/'.$item->{PRODUCTS_PRODUCT_ID})?>"><div class="edit_icon">|</div></a>
        <a href="javascript:products.deleteOne(<?=$start?>, <?=$item->{PRODUCTS_PRODUCT_ID}?>, '<?=$group?>');"><div class="delete_icon"></div></a>
    </td>
  <tr>
<?$i=-$i;}?>
  <tr>
    <td colspan="7">
	<? if ($items) { if ($paging) { ?>
      <table class="adminlist" border="0" cellpadding="0" cellpadding="0" width="100%" class="PagingTable">
        <tr>
          <td class="pageCounter" width="100%" align="center">
            {paging}
          </td>
        </tr>
      </table>
	<? }} else { ?>
		<br />
		<?=$this->lang->line('not_found')?>
	<? } ?>
    </td>
  </tr>
</table>
</form>